package com.itheima.mall.service.pms;

import com.itheima.mall.api.pms.PmsProductAttributeServiceApi;
import com.itheima.mall.pojo.pms.ProductAttribute;
import com.itheima.mall.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class PmsProductAttributeService {
    @DubboReference
    private PmsProductAttributeServiceApi pmsProductAttributeServiceApi;


    //添加商品属性信息
    public void create(ProductAttribute productAttribute) {
        //执行新增
        pmsProductAttributeServiceApi.create(productAttribute);
    }

    //批量删除商品属性delete
    public void delete(Long[] ids) {
        //执行删除操作
        pmsProductAttributeServiceApi.delete(ids);
    }

    //修改商品属性信息
    public void update(ProductAttribute productAttribute,Long id) {
        //执行修改操作
        productAttribute.setId(id);
        pmsProductAttributeServiceApi.update(productAttribute);
    }
    //查询单个商品属性
    public ProductAttribute getById(Integer id) {
        //执行查询操作
        return pmsProductAttributeServiceApi.getById(id);
    }
}
